﻿//
// Created by Administrator on 2020/8/29.
//
#include "String.h"


void printString(String str) {
    std::cout << str << std::endl;
}

int main() {

    const String str1("str1");
    {
        std::cout << "start copy construct......" << std::endl;

        std::cout << str1 << std::endl;

        printString(str1);
        std::cout << "end copy construct......" << std::endl;
    }

    {
        std::cout << "start assign construct......" << std::endl;
        String str2("str2");
        printString(str2);
        str2 = str1;
        std::cout << "end assign construct......" << std::endl;
    }

    std::cout << String::getStrNum() << std::endl;
    std::cout << str1[2] << std::endl;

    return 0;
}
